﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 

namespace class3_work1
{
     abstract class Graph
    {//宽度
        public double width;
        //长度
public  double length;
        //面积
        public abstract double Area();
        //周长
        public abstract double Perimeter();
        //初始化数据
        
        public abstract bool isTrue();
        public bool iss = true;
 
}
    class Triangle : Graph
    {
        public override double Area()
        {
            return width * length / 2;
        }

        public  Triangle(double length, double width)
        {   
                this.length = length;
            this.width = width;
        }

        public override bool isTrue()
        {if (width <= 0 || length <= 0) return false;
            else return iss;
        }

        public override double Perimeter()
        {
            throw new NotImplementedException();
        }
    }
    class Square : Graph
    {
        public override double Area()
        {if (isTrue())
                Console.WriteLine($"正方形的面积为： +{length * length}");
            else return -1;
            throw new NotImplementedException();
        }

        public Square()
        {
            this.length = length;
            this.width = width;
        }

        public override bool isTrue()
        {
            if (length == width) iss = true;
            else return false;
            throw new NotImplementedException();

        }

        public override double Perimeter()
        {
            Console.WriteLine("该图形的周长为：" + 4 * length);
            throw new NotImplementedException();

        }
    }
    class Rectangle : Graph
    {
        public double Thrid = 0.0;
        public override double Area()
        {
            Console.WriteLine("哈哈哈");
            Console.WriteLine("该图形的面积为：" + length * width);
            throw new NotImplementedException();
        }

        public   Rectangle()
        {
            this.Thrid = Thrid;
            this.length = length;
            this.width = width;
        }

        public override bool isTrue()
        { if (this.Thrid <= 0 || this.length <= 0 ||this.width <= 0)
            {
                return false;
                Console.WriteLine("输入错误，请重试");

            }
            else
            {
                if (Thrid + length > width && length + width > Thrid && Thrid + length > width)
                {
                    Console.WriteLine("ZHENG QUE");

                } else return false;
            }
            throw new NotImplementedException();
        }

        public override double Perimeter()
        {
            return length + width + Thrid;
            throw new NotImplementedException();
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
           String se = Console.ReadLine();
            String st = Console.ReadLine();
            Triangle r = new Triangle( double.Parse (se),double.Parse(st));

        }
    }
}
